1. Field of the Invention
The present invention relates to an image processing apparatus that processes image data obtained by photographing a measuring object, and particularly relates to a technique of extending a dynamic range by photographing the measuring object a plurality of times under different exposure conditions.
2. Description of the Related Art
In a FA (Factory Automation) field, a so-called visual sensor is put to practical use, as an apparatus for optically inspecting a defect, etc, generated in a measuring object such as a workpiece, and optically measuring a size of this defect.
When an inspection and a measurement are performed by using the aforementioned visual sensor, the measuring object must be properly photographed. Generally, a dynamic range (a gradation range capable of expressing luminance) of an image pickup apparatus including a CCD (Coupled Charged Device) and a CMOS (Complementary Metal Oxide Semiconductor) sensor is limited. Therefore, when an exposure time at the time of photographing is prolonged, total or partial (overexposure) halation occurs, and luminance information and color information of the measuring object can not be accurately acquired. Reversely, when the exposure time is shortened, total or partial underexposure occurs, and therefore effective luminance information can not be acquired. Further, in the measuring object having a part of locally different reflectance and the measuring object having a part with large curvature, partial overexposure or underexposure occurs, under influence of lighting.
Thus, when a change width of an optical energy (brightness) generated from the same measuring object exceeds a range of the dynamic range of the image pickup apparatus, there is a problem that the whole body of the measuring object can not be properly photographed.
Therefore, a technique of extending the dynamic range is known, in which the dynamic range is extended by photographing the same measuring object a plurality of times under different photographing conditions (particularly exposure condition), and combining image data obtained by each photographing. Such a processing is also called a high dynamic composition processing and a super latitude processing (Super Latitude process; SL processing). For example, Japanese Patent Laid Open publication No. 2002-334326 discloses a visual sensor realizing extension of the dynamic range by a low calculation processing load.
Generally, as the number of times of photographing is increased, extension of the dynamic range and improvement of accuracy of a composite image can be expected. However, in this case, processing time is prolonged, along with an increase of the number of times of photographing. That is, extension of the dynamic range is in a trade-off relation with processing time. Incidentally, in an actual production site, inspection and measurement must be performed, directed to the measuring object sequentially conveyed on a conveying device such as a belt conveyor. Therefore, the processing time that can be allotted to each measuring object is limited. Accordingly, photographing conditions (exposure condition, the number of times of photographing, and lighting condition, etc.) must be properly set, with a balance between required accuracy of the composite image and the processing time in mind.
In addition, on a production line such as a small lot multi-product production, the kind of a workpiece, being the measuring object, is frequently changed. Even when such a workpiece is changed, fine adjustment of the photographing conditions must be performed.
Further, even in a case of an operator of the production line who does not have a total knowledge of a visual sensor, the photographing conditions must be set properly, and it is necessary to determine whether or not image composition processing is properly executed.
Therefore, the present invention is provided in order to solve the above-described problem, and a first object of the present invention is to provide an image processing apparatus capable of properly setting the photographing conditions, in consideration of the time allowable for each processing. Also, a second object of the present invention is to provide an image processing apparatus capable of properly setting the photographing conditions while referring to an actually generated composite image. In addition, a third object of the present invention is to provide an image processing apparatus capable of properly setting the photographing conditions, even in a case of a user having no background knowledge. Further, a fourth object of the present invention is to provide an image processing apparatus capable of determining whether or not the image composition processing is properly executed even in a case of a user who has no background knowledge.